<form id="frm_consulta_local" name="frm_consulta_local" method="post" action="<?php echo $this->action;?>">
  <table border="0">
    <tr>
      <td>Nome</td>
      <td colspan="4"><input type="text" name="nome" id="nome" size="45" maxlength="50" value="<?php echo $this->escape($this->local->ds_local);?>" /></td>
      <td>&nbsp;</td>
    </tr>
	<tr>
    <td>País:</td>
    <td width="30" colspan="4"><select name="pais" id="pais" onChange="if (this.options[this.selectedIndex].value){selecionaEstados(this.options[this.selectedIndex].value)}">
      <?php echo UtilController::getOptionPais($this->juridica->id_pais, 0);?>
    </select></td>
    <td>&nbsp;</td>
    </tr>
    <tr>
      <td>Estado/Província</td>
      <td colspan="4"><select  name="estado" id="estado" onChange="if (this.options[this.selectedIndex].value){selecionaCidades(this.options[this.selectedIndex].value)}">
        <?php echo UtilController::getOptionEstadoPorPais($this->juridica->id_pais, $this->juridica->id_estado, 0); ?>
      </select></td>
    </tr>
    <tr>
      <td>Cidade</td>
      <td colspan="4"><select name="cidade" id="cidade">
        <?php echo UtilController::getOptionCidadePorEstado($this->juridica->id_estado, $this->juridica->id_cidade); ?>
      </select></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="6" align="right"><input type="submit" name="btConsultar" id="btConsultar" value="Consultar" /></td>
    </tr>
  </table>
</form>
<?php if ($this->dadosConsulta != null && count($this->dadosConsulta) > 0) {?>
<table  id="item" class="table displaytag">
	<thead>
    <tr>
      <th class="col"><a href="<?php echo UtilController::trataLinkOrdenacao($this->parametrosConsulta, $this->ordemAtual, "1", $this->asc);?>">Local</a></th>
      <th class="col"><a href="<?php echo UtilController::trataLinkOrdenacao($this->parametrosConsulta, $this->ordemAtual, "2", $this->asc);?>">Estado</a></th>
      <th class="col"><a href="<?php echo UtilController::trataLinkOrdenacao($this->parametrosConsulta, $this->ordemAtual, "3", $this->asc);?>">Cidade</a></th>
      <th scope="col">&nbsp;</th>
      <th scope="col">&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <?php $grid = 0;
     foreach($this->dadosConsulta as $item) :
     $classgrid = $grid % 2 == 0 ? "row_off" : "row_on";
     $grid++;
     ?>
     <tr class="<?php echo $classgrid;?>" onMouseOver="this.style.backgroundColor='#FFF4B7';" onMouseOut="this.style.backgroundColor='';">
      <td><?php echo $item['ds_local'];?></td>
      <td><?php echo $item['ds_estado'];?></td>
      <td><?php echo $item['ds_cidade'];?></td>
      <td width=20px><a href="<?php echo $this->baseUrl; ?>/local/edit/id/<?php echo $item['id_local'];?>"><img src="/bntmercosul/public/images/edit.png" border="0"></a></td>
  	  <td width=20px><a href="<?php echo $this->baseUrl; ?>/local/excluir/id/<?php echo $item['id_local'];?>" onClick='return confirma_exclusao();'><img src="/bntmercosul/public/images/remove.png" border="0"></a></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
  </table>

<?php } ?>
